$(function() {	

	$(".rule-text.ui-wizard-content[name=application]").autocomplete({
	source: function (request, response) {
	    $.ajax({
	      url: "/rules/get_json", type: "POST", dataType: "json",
	      data: { startApp: request.term },
		      success: function (data) {
	        response($.map(data, function (item) {
	            return {label:item.label, exe:item.exe}
	        }));
	      }
	    });
	  },
	  select: function( event, ui ) {
	    $(".rule-text.ui-wizard-content[name=application]").val(ui.item.label);
	
	  }
	})


   

});